<?php
class AdminController extends Controller
{

    function showIndex()
    {
        $this->putIntoPage("lastNews", $this->modules->News->findLast(6));
        $this->putIntoPage("lastNews_total_count", $this->modules->News->getTotalCount());
        $this->putIntoPage("lastActivity_total_count", $this->modules->Activity->getTotalCount());
        $this->putIntoPage("lastActivity", $this->modules->Activity->findLast(6));
        $this->render("Dashboard");
    }


    function votes()
    {
        $pagination_sql = "select * from vote where status <> 'EXPIRED' order by createDate desc";
        $pagination_count_sql = "select count(1) as count from vote where status <> 'EXPIRED' order by createDate desc ";
        $this->putIntoPage("pagination", $this->modules->Vote->pagination($pagination_sql, $pagination_count_sql));
        $this->render("VotesList");
    }


    function Login()
    {
        $this->render("AdminLogin");
    }

}

?>